Jumbo patch from Mottram.
authorrobertl <robertl@f51c46e8-681c-474f-0cfe-069cfd0219fb>
Fri, 10 Jan 2003 18:28:02 +0000 (18:28 +0000)
committerrobertl <robertl@f51c46e8-681c-474f-0cfe-069cfd0219fb>
Fri, 10 Jan 2003 18:28:02 +0000 (18:28 +0000)
Fix README.
Use sprintf becuase snprintf is unfortunately not in C89.
Make testo play nicer with PSP to avoid hyperactive fp differences.
tpg.c avoid sign extension.
Various style files: don't use %lf.

15 files changed:
gpsbabel/README
gpsbabel/csv_util.c
gpsbabel/style/README.style
gpsbabel/style/csv.style
gpsbabel/style/custom.style
gpsbabel/style/dna.style
gpsbabel/style/gpsdrive.style
gpsbabel/style/gpsman.style
gpsbabel/style/nima.style
gpsbabel/style/ozi.style
gpsbabel/style/s_and_t.style
gpsbabel/style/tiger.style
gpsbabel/style/xmap.style
gpsbabel/testo
gpsbabel/tpg.c

index cab201249e5293d8c34b82dbae2be67b2e760e4f..a0c37019ebe5adfc3ad57d9eb92d9e3bdd3a90fb 100644 (file)
@@ -135,8 +135,8 @@ THE FORMATS
        NOTE:   sn* options require use of the '-s' command line option.
 
        Example Usage:
-       gpsbabel -i xsv,style=foo.style -f foo -o xsv,style=bar.style -F bar
-       gpsbabel -s -i gpx -f foo.gpx -o xsv,style=my.style,snlen=8 -F bar
+       gpsbabel -i xcsv,style=foo.style -f foo -o xcsv,style=bar.style -F bar
+       gpsbabel -s -i gpx -f foo.gpx -o xcsv,style=my.style,snlen=8 -F bar
 
     MAPSEND
 
index 03fe2f880712b2f916e3b0f60ea7663ae8afcec4..cf5ee4a2fe958ecf84b71d389d1dc73377ebc320 100644 (file)
@@ -612,133 +612,127 @@ xcsv_waypt_pr(const waypoint *wpt)
 
         if (strcmp(fmp->key, "IGNORE") == 0) {
             /* IGNORE -- Write the char printf conversion */
-            snprintf (buff, sizeof(buff), fmp->printfc, "");
+            sprintf(buff, fmp->printfc, "");
         } else
         if (strcmp(fmp->key, "INDEX") == 0) {
-            snprintf (buff, sizeof(buff), fmp->printfc, index + atoi(fmp->val));
+            sprintf(buff, fmp->printfc, index + atoi(fmp->val));
         } else
         if (strcmp(fmp->key, "CONSTANT") == 0) {
-            snprintf (buff, sizeof(buff), fmp->printfc, fmp->val);
+            sprintf(buff, fmp->printfc, fmp->val);
         } else
         if (strcmp(fmp->key, "SHORTNAME") == 0) {
-            snprintf (buff, sizeof(buff), fmp->printfc, shortname);
+            sprintf(buff, fmp->printfc, shortname);
         } else
         if (strcmp(fmp->key, "ANYNAME") == 0) {
-            snprintf (buff, sizeof(buff), fmp->printfc, anyname);
+            sprintf(buff, fmp->printfc, anyname);
         } else
         if (strcmp(fmp->key, "DESCRIPTION") == 0) {
-            snprintf (buff, sizeof(buff), fmp->printfc, description);
+            sprintf(buff, fmp->printfc, description);
         } else
         if (strcmp(fmp->key, "NOTES") == 0) {
-            snprintf (buff, sizeof(buff), fmp->printfc, wpt->notes);
+            sprintf(buff, fmp->printfc, wpt->notes);
         } else
         if (strcmp(fmp->key, "URL") == 0) {
-            snprintf (buff, sizeof(buff), fmp->printfc, wpt->url);
+            sprintf(buff, fmp->printfc, wpt->url);
         } else
         if (strcmp(fmp->key, "URL_LINK_TEXT") == 0) {
-            snprintf (buff, sizeof(buff), fmp->printfc, wpt->url_link_text);
+            sprintf(buff, fmp->printfc, wpt->url_link_text);
         } else
         if (strcmp(fmp->key, "ICON_DESCR") == 0) {
-            snprintf (buff, sizeof(buff), fmp->printfc, wpt->icon_descr);
+            sprintf(buff, fmp->printfc, wpt->icon_descr);
         } else
 
         /* LATITUDE CONVERSION***********************************************/
         if (strcmp(fmp->key, "LAT_DECIMAL") == 0) {
             /* latitude as a pure decimal value */
-            snprintf (buff, sizeof(buff), fmp->printfc,
-              wpt->position.latitude.degrees);
+            sprintf(buff, fmp->printfc, wpt->position.latitude.degrees);
         } else
         if (strcmp(fmp->key, "LAT_DECIMALDIR") == 0) {
             /* latitude as a decimal value with N/S after it */
-            snprintf (buff, sizeof(buff), fmp->printfc,
-              fabs(wpt->position.latitude.degrees), 
+            sprintf(buff, fmp->printfc, fabs(wpt->position.latitude.degrees), 
               LAT_DIR(wpt->position.latitude.degrees));
         } else
         if (strcmp(fmp->key, "LAT_DIRDECIMAL") == 0) {
             /* latitude as a decimal value with N/S before it */
-            snprintf (buff, sizeof(buff), fmp->printfc,
+            sprintf(buff, fmp->printfc, 
               LAT_DIR(wpt->position.latitude.degrees),
               fabs(wpt->position.latitude.degrees));
         } else
         if (strcmp(fmp->key, "LAT_INT32DEG") == 0) {
             /* latitude as an integer offset from 0 degrees */
-            snprintf (buff, sizeof(buff), fmp->printfc,
+            sprintf(buff, fmp->printfc,
               dec_to_intdeg(wpt->position.latitude.degrees, 1));
         } else
 
         /* LONGITUDE CONVERSIONS*********************************************/
         if (strcmp(fmp->key, "LON_DECIMAL") == 0) {
             /* longitude as a pure decimal value */
-            snprintf (buff, sizeof(buff), fmp->printfc,
-              wpt->position.longitude.degrees);
+            sprintf(buff, fmp->printfc, wpt->position.longitude.degrees);
         } else
         if (strcmp(fmp->key, "LON_DECIMALDIR") == 0) {
             /* latitude as a decimal value with N/S after it */
-            snprintf (buff, sizeof(buff), fmp->printfc,
+            sprintf(buff, fmp->printfc,
               fabs(wpt->position.longitude.degrees), 
               LON_DIR(wpt->position.longitude.degrees));
         } else
         if (strcmp(fmp->key, "LON_DIRDECIMAL") == 0) {
             /* latitude as a decimal value with N/S before it */
-            snprintf (buff, sizeof(buff), fmp->printfc,
+            sprintf(buff, fmp->printfc,
               LON_DIR(wpt->position.longitude.degrees),
               fabs(wpt->position.longitude.degrees));
         } else
         if (strcmp(fmp->key, "LON_INT32DEG") == 0) {
             /* longitudee as an integer offset from 0 degrees */
-            snprintf (buff, sizeof(buff), fmp->printfc,
+            sprintf(buff, fmp->printfc,
               dec_to_intdeg(wpt->position.longitude.degrees, 0));
         } else
 
         /* DIRECTIONS *******************************************************/
         if (strcmp(fmp->key, "LAT_DIR") == 0) {
             /* latitude N/S as a char */
-            snprintf (buff, sizeof(buff), fmp->printfc,
-              LAT_DIR(wpt->position.latitude.degrees));
+            sprintf(buff, fmp->printfc,
+            LAT_DIR(wpt->position.latitude.degrees));
         } else
         if (strcmp(fmp->key, "LON_DIR") == 0) {
             /* longitude E/W as a char */
-            snprintf (buff, sizeof(buff), fmp->printfc,
+            sprintf(buff, fmp->printfc,
               LON_DIR(wpt->position.longitude.degrees));
         } else
 
         /* ALTITUDE CONVERSIONS**********************************************/
         if (strcmp(fmp->key, "ALT_FEET") == 0) {
             /* altitude in feet as a decimal value */
-            snprintf (buff, sizeof(buff), fmp->printfc,
+            sprintf(buff, fmp->printfc,
               (wpt->position.altitude.altitude_meters * 3.2808));
         } else
         if (strcmp(fmp->key, "ALT_METERS") == 0) {
             /* altitude in meters as a decimal value */
-            snprintf (buff, sizeof(buff), fmp->printfc,
+            sprintf(buff, fmp->printfc,
               wpt->position.altitude.altitude_meters);
         } else
 
         /* TIME CONVERSIONS**************************************************/
         if (strcmp(fmp->key, "EXCEL_TIME") == 0) {
             /* creation time as an excel (double) time */
-            snprintf (buff, sizeof(buff), fmp->printfc,
-              TIMET_TO_EXCEL(wpt->creation_time));
+            sprintf(buff, fmp->printfc, TIMET_TO_EXCEL(wpt->creation_time));
         } else
         if (strcmp(fmp->key, "TIMET_TIME") == 0) {
             /* time as a time_t variable */
-            snprintf (buff, sizeof(buff), fmp->printfc, wpt->creation_time);
+            sprintf(buff, fmp->printfc, wpt->creation_time);
         } else
 
         /* GEOCACHE STUFF **************************************************/
         if (strcmp(fmp->key, "GEOCACHE_DIFF") == 0) {
             /* Geocache Difficulty as a double */
-            snprintf (buff, sizeof(buff), fmp->printfc,
-              wpt->gc_data.diff / 10);
+            sprintf(buff, fmp->printfc, wpt->gc_data.diff / 10);
         } else
         if (strcmp(fmp->key, "GEOCACHE_TERR") == 0) {
             /* Geocache Terrain as a double */
-            snprintf (buff, sizeof(buff), fmp->printfc,
-              wpt->gc_data.terr / 10);
+            sprintf(buff, fmp->printfc, wpt->gc_data.terr / 10);
         } else
         if (strcmp(fmp->key, "GEOCACHE_TYPE") == 0) {
             /* Geocache Type TODO */
-            snprintf (buff, sizeof(buff), fmp->printfc, "Geocache");
+            sprintf(buff, fmp->printfc, "Geocache");
         } else {
            /* this should probably never happen */
         }
index bb56f4c36a01e33b346d257edd6816362c461621..1d9e77efe231ecec587cc18ef598fc652220acfb 100644 (file)
@@ -36,8 +36,8 @@ HASH                  #
 COMMENTS:
 Anything after a hash (#) on a line is not parsed.  For example:
 #THIS ENTIRE LINE IS A COMMENT.
-#FIELD LAT_DECIMAL, "", "%lf"   THIS ENTIRE LINE IS A COMMENT
-FIELD LAT_DECIMAL, "", "%lf"  # ONLY THIS SENTENCE IS A COMMENT.
+#FIELD LAT_DECIMAL, "", "%f"   THIS ENTIRE LINE IS A COMMENT
+FIELD LAT_DECIMAL, "", "%f"  # ONLY THIS SENTENCE IS A COMMENT.
 
 
 DEFINING THE LAYOUT OF THE FILE:
@@ -188,7 +188,7 @@ The fields used by the XCSV parser are as follows:
    signed decimal format (i.e. -91.0000).  This data is handled internally as 
    a DOUBLE PRECISION FLOAT and requires a FLOATING POINT printf conversion.
 
-   example: IFIELD LAT_DECIMAL,"","%lf"
+   example: IFIELD LAT_DECIMAL,"","%f"
 
  o LON_DECIMAL
    See LAT_DECIMAL, except LON_DECIMAL defines LONGITUDE.
@@ -211,8 +211,8 @@ The fields used by the XCSV parser are as follows:
    character appears before (LAT_DIRDECIMAL) or after (LAT_DECIMALDIR) the
    decimal number.
    
-   example: IFIELD LAT_DECIMALDIR,"","%lf %c"
-   example: IFIELD LAT_DIRDECIMAL,"","%c %08.5lf"
+   example: IFIELD LAT_DECIMALDIR,"","%f %c"       (writes 31.333 N)
+   example: IFIELD LAT_DIRDECIMAL,"","%c %f"       (writes N 31.333)
 
  o LON_DECIMALDIR / LON_DIRDECIMAL
    Same as LAT_DECIMALDIR / LAT_DIRDECIMAL except LON_ defines LONGITUDE.
@@ -223,7 +223,7 @@ The fields used by the XCSV parser are as follows:
    a SIGNED DOUBLE PRECISION FLOAT and requires a FLOATING POINT printf 
    conversion.
 
-   example: IFIELD ALT_FEET,"","%.0lf"
+   example: IFIELD ALT_FEET,"","%.0f"
 
  o ALT_METERS
    ALT_METERS is identical to ALT_FEET with the exception that the altitude
@@ -234,7 +234,7 @@ The fields used by the XCSV parser are as follows:
    the decimal days since 1/1/1900 and is handled internally as a DOUBLE
    PRECISION FLOAT and requires a FLOATING POINT printf conversion.
 
-   example: IFIELD EXCEL_TIME,"","%11.5lf"
+   example: IFIELD EXCEL_TIME,"","%11.5f"
 
  o TIMET_TIME
    TIMET_TIME is the waypoint's creation time, if any.  This is actually
index 8866a73f4611636726ba589e828984e0c0673ba8..9236f89830fff59082b00f44d8026051388c9f20 100644 (file)
@@ -17,6 +17,6 @@ BADCHARS              COMMA
 #
 # INDIVIDUAL DATA FIELDS, IN ORDER OF APPEARANCE:
 #
-IFIELD LAT_DECIMAL, "", "%08.5lf"
-IFIELD LON_DECIMAL, "", "%08.5lf"
+IFIELD LAT_DECIMAL, "", "%08.5f"
+IFIELD LON_DECIMAL, "", "%08.5f"
 IFIELD DESCRIPTION, "", "%s"
index af22154c32a2ae7bb584b2db6474b8841351485b..a9fc40b9147da765abe6736b303a614545221343 100644 (file)
@@ -22,9 +22,9 @@ PROLOGUE      Prologue Line 2
 #
 IFIELD CONSTANT, "", "CONSTANT"
 IFIELD INDEX, "", "%d"
-IFIELD LAT_DECIMAL, "", "%lf"
+IFIELD LAT_DECIMAL, "", "%f"
 IFIELD LAT_DIR, "", "%c"
-IFIELD LON_DECIMAL, "", "%lf"
+IFIELD LON_DECIMAL, "", "%f"
 IFIELD LON_DIR, "", "%c"
 IFIELD ICON_DESCR, "", "%s"
 IFIELD SHORTNAME, "", "%s"
@@ -32,16 +32,16 @@ IFIELD      DESCRIPTION, "", "%s"
 IFIELD NOTES, "", "%s"
 IFIELD URL, "", "%s"           
 IFIELD URL_LINK_TEXT, "", "%s"
-IFIELD ALT_METERS, "", "%lfM"
-IFIELD ALT_FEET, "", "%lfF"
-IFIELD LAT_DECIMALDIR, "", "%lf/%c"
-IFIELD LON_DECIMALDIR, "", "%lf/%c"
-IFIELD LAT_DIRDECIMAL, "", "%c/%lf"
-IFIELD LON_DIRDECIMAL, "", "%c/%lf"
+IFIELD ALT_METERS, "", "%fM"
+IFIELD ALT_FEET, "", "%fF"
+IFIELD LAT_DECIMALDIR, "", "%f/%c"
+IFIELD LON_DECIMALDIR, "", "%f/%c"
+IFIELD LAT_DIRDECIMAL, "", "%c/%f"
+IFIELD LON_DIRDECIMAL, "", "%c/%f"
 IFIELD LAT_INT32DEG, "", "%ld"
 IFIELD LON_INT32DEG, "", "%ld"
 IFIELD TIMET_TIME, "", "%ld"
-IFIELD EXCEL_TIME, "", "%lf"
+IFIELD EXCEL_TIME, "", "%f"
 
 # EPILOGUE: 
 EPILOGUE       Epilogue Line 1
index d94dc392a471c686066671d5159a71bbf95f9c70..4b68c1466d2246ad81c6de78a2b61f841d7d1ec2 100644 (file)
@@ -18,7 +18,7 @@ BADCHARS              COMMA
 # INDIVIDUAL DATA FIELDS, IN ORDER OF APPEARANCE:
 #
 IFIELD INDEX, "", "%d"
-IFIELD LAT_DECIMAL, "", "%08.5lf"
-IFIELD LON_DECIMAL, "", "%08.5lf"
+IFIELD LAT_DECIMAL, "", "%08.5f"
+IFIELD LON_DECIMAL, "", "%08.5f"
 IFIELD DESCRIPTION, "", "%s"
 
index e743bcd2a6255bac51d87a2c206be2ade0da5395..ced93534876e39ba326a764fe0a936a4bbea5900 100644 (file)
@@ -16,5 +16,5 @@ BADCHARS              ,"
 # INDIVIDUAL DATA FIELDS, IN ORDER OF APPEARANCE:
 
 IFIELD ANYNAME, "", "%s"
-IFIELD LAT_DECIMAL, "", "%08.5lf"
-IFIELD LON_DECIMAL, "", "%08.5lf"
+IFIELD LAT_DECIMAL, "", "%08.5f"
+IFIELD LON_DECIMAL, "", "%08.5f"
index e6b74c82571dc6288da2cd6bad9eaf6db402a68c..711e6b1e02fea5e06169c4f7de81e2b68ad68757 100644 (file)
@@ -22,8 +22,8 @@ PROLOGUE      !W:
 #
 IFIELD SHORTNAME, "", "%-8.8s"
 IFIELD DESCRIPTION, "", "%s"
-IFIELD LAT_DIRDECIMAL, "", "%c%lf"
-IFIELD LON_DIRDECIMAL, "", "%c%lf"
+IFIELD LAT_DIRDECIMAL, "", "%c%f"
+IFIELD LON_DIRDECIMAL, "", "%c%f"
 IFIELD IGNORE, "", "%s"
 
 # gpsman.c likes mkshort len = 8, whitespace = 0.
index a9b684528da0e095f198f8b4a17646a5b7b2fee9..7cc42c254ce927f4ca1cc7a4f7ecdb94d074bcf9 100644 (file)
@@ -18,8 +18,8 @@ PROLOGUE      RC      UFI     UNI     DD_LAT  DD_LONG DMS_LAT DMS_LONG        UTM     JOG     FC      DSG     PC      CC1     ADM1    A
 IFIELD IGNORE, "", "%s"                # RC
 IFIELD IGNORE, "", "%s"                # UFI
 IFIELD IGNORE, "", "%s"                # UNI
-IFIELD LAT_DECIMAL, "", "%lf"          # DD_LAT
-IFIELD LON_DECIMAL, "", "%lf"          # DD_LON
+IFIELD LAT_DECIMAL, "", "%f"           # DD_LAT
+IFIELD LON_DECIMAL, "", "%f"           # DD_LON
 IFIELD IGNORE, "", "%s"                # DMS_LAT
 IFIELD IGNORE, "", "%s"                # DMS_LON
 IFIELD IGNORE, "", "%s"                # UTM
index 0acea285d47e024b7a9cdb5693e9f6e36b6e977d..dad2123fa916c5d2d63f2b146a1071839b2626b5 100644 (file)
@@ -24,9 +24,9 @@ PROLOGUE      Reserved 3
 #
 IFIELD INDEX, "1", "%4d"
 IFIELD SHORTNAME, "", "%-14.14s"
-IFIELD LAT_DECIMAL, "", "%11.6lf"
-IFIELD LON_DECIMAL, "", "%11.6lf"
-IFIELD EXCEL_TIME, "", "%011.5lf"
+IFIELD LAT_DECIMAL, "", "%11.6f"
+IFIELD LON_DECIMAL, "", "%11.6f"
+IFIELD EXCEL_TIME, "", "%011.5f"
 IFIELD CONSTANT, "0", "%3s"            # icon 
 IFIELD CONSTANT, "1", "%2s"            # 1 
 IFIELD CONSTANT, "3", "%2s"            # display format opts 
@@ -36,7 +36,7 @@ IFIELD        DESCRIPTION, "", "%-40.40s"
 IFIELD CONSTANT, "0", "%2s"            # pointer direction 
 IFIELD CONSTANT, "0", "%2s"            # garmin display flags 
 IFIELD CONSTANT, "0", "%5s"            # proximity distance 
-IFIELD ALT_FEET, "", "%7.0lf"
+IFIELD ALT_FEET, "", "%7.0f"
 IFIELD CONSTANT, "6", "%2s"            # waypt name text size 
 IFIELD CONSTANT, "0", "%2s"            # bold checkbox 
 IFIELD CONSTANT, "17", "%2s"           # symbol size 
index 11a418d452639d03c1de38c47203c6b22628775a..19c5c0a8b1098ad53d3a5309dc2d0e68b8d58fdc 100644 (file)
@@ -26,8 +26,8 @@ PROLOGUE      Name,Latitude,Longitude,Name 2,URL,Type
 #       HAVE OUR WAY WITH THE FORMATTING. 
 #
 IFIELD SHORTNAME, "", "%s"             # Name
-IFIELD LAT_DECIMAL, "", "%lf"          # Latitude
-IFIELD LON_DECIMAL, "", "%lf"          # Longitude
+IFIELD LAT_DECIMAL, "", "%f"           # Latitude
+IFIELD LON_DECIMAL, "", "%f"           # Longitude
 IFIELD DESCRIPTION, "", "%s"           # Name 2 (Big Description)
 IFIELD URL, "", "%s"                   # URL
 IFIELD IGNORE, "", ""                  # Holder for Geocache Type
index 8254ea97400ba84b8c19d9568ebfb86b1ccf6509..01170520341e8978586b49d75391cf63b57bd0ab 100644 (file)
@@ -17,7 +17,7 @@ BADCHARS              COLON
 #
 # INDIVIDUAL DATA FIELDS, IN ORDER OF APPEARANCE:
 #
-IFIELD LON_DECIMAL, "", "%lf"
-IFIELD LAT_DECIMAL, "", "%lf"
+IFIELD LON_DECIMAL, "", "%f"
+IFIELD LAT_DECIMAL, "", "%f"
 IFIELD CONSTANT, "redpin", "%s"
 IFIELD DESCRIPTION, "", "%s"
index 7570667f5edc6f7136cbeef36da9ff1157f98d51..f9453416bd83e26f850222e146123b7b5a23aa55 100644 (file)
@@ -19,6 +19,6 @@ EPILOGUE      END
 #
 # INDIVIDUAL DATA FIELDS, IN ORDER OF APPEARANCE:
 #
-IFIELD LAT_DECIMAL, "", "%08.5lf"
-IFIELD LON_DECIMAL, "", "%08.5lf"
+IFIELD LAT_DECIMAL, "", "%08.5f"
+IFIELD LON_DECIMAL, "", "%08.5f"
 IFIELD DESCRIPTION, "", "%s"
index 577ab6080e645cdc8c95a9987577b90092f6214f..ba1702963b815a5a5fce966965ee289ab4156170 100755 (executable)
@@ -80,11 +80,12 @@ diff ${TMPDIR}/magfile reference/magfile
 ${PNAME} -i dna -f reference/dnatest.txt -o dna -F ${TMPDIR}/dnatest.txt
 diff ${TMPDIR}/dnatest.txt reference/dnatest.txt
 
-# PSP (PocketStreets 2002 Pushpin (.PSP)) file format
-rm -f ${TMPDIR}/ps.psp ${TMPDIR}/psp.psp
-${PNAME} -i psp -f reference/ps.psp -o psp -F ${TMPDIR}/psp.psp
-${PNAME} -i psp -f ${TMPDIR}/psp.psp -o psp -F ${TMPDIR}/ps.psp
-diff ${TMPDIR}/ps.psp reference
+# PSP (PocketStreets 2002 Pushpin (.PSP)) file format. Use mxf as an 
+# intermediate format to avoid binary FP anomalies on different platforms.
+rm -f ${TMPDIR}/psp.mxf ${TMPDIR}/mxf.psp
+${PNAME} -i psp -f reference/ps.psp -o mxf -F ${TMPDIR}/psp.mxf
+${PNAME} -i geo -f geocaching.loc -o mxf -F ${TMPDIR}/mxf.psp
+diff ${TMPDIR}/psp.mxf ${TMPDIR}/mxf.psp
 
 # MXF (Maptech Exchange Format) file format
 rm -f ${TMPDIR}/mx.mxf ${TMPDIR}/mxf.mxf
index dc005a38335b3f96dba1d4606c00e2f25b448ccc..ad756ea8ef296551763a4ab482e8788c5b133ec8 100644 (file)
@@ -254,10 +254,10 @@ tpg_waypt_pr(const waypoint *wpt)
        char *description;
 
         /* these unknown 4 are probably point properties (color, icon, etc..) */
-       char unknown4[] = { 0x78, 0x56, 0x34, 0x12 }; 
+       unsigned char unknown4[] = { 0x78, 0x56, 0x34, 0x12 }; 
 
         /* these 2 appear to be constant across test files */
-       char unknown2[] = { 0x01, 0x80 };  
+       unsigned char unknown2[] = { 0x01, 0x80 };  
        
         /* this output format pretty much requires a description
          * and a shortname